{include file="public/header" /}
<link rel="stylesheet" href="/static/css/log-off.css"/>
<body>
<header class="mui-bar mui-bar-nav mui-box-header ">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title mui-title-box">用户注册</h1>
    <a class="mui-action-back mui-icon mui-icon-compose mui-pull-right"></a>
</header>
<div class="mui-content">
    <div class="kk">
        <h1 class="mui-title kk-title">卡卡管家</h1>
    </div>
    <form class="mui-input-group">
        <div class="mui-input-row">
            <label style="width:20%">手机</label>
            <button type="button" class="mui-btn mui-btn-warning reg-user"  onclick="common.sendSms($('input[name=mobile]').val(),this)" style="width:27%;padding:11px 2px;">获取验证码</button>
            <input id=''  type="tel" name="mobile" class="mui-input-clear mui-input iphone_1" placeholder="请输入手机号码">
        </div>
        <div class="mui-input-row">
            <label>验证码</label>
            <input  type="number" name="smscode" class="mui-input-clear mui-input" placeholder="请输入验证码" style="font-size: 14px">
        </div>
        <div class="mui-input-row">
            <label>密码</label>
            <input style="font-size:14px" type="password" name="password" class="mui-input-clear mui-input" placeholder="请输入密码">
        </div>
        <div class="mui-input-row">
            <label>激活码</label>
            <input style="font-size:14px" type="text" name="code" class="mui-input-clear mui-input" placeholder="请输入激活码">
        </div>
        <div class="mui-input-row mui-checkbox mui-left">
            <input name="agree"  type="checkbox" checked  value="1">
            <label>同意《卡卡管家注册协议》</label>
        </div>
    </form>

    <div class="mui-content-padded">
        <a ><button id='submit' class="mui-btn mui-btn-block mui-btn-primary">确认注册</button></a>
        <a href="{:url('index')}"><button  class="mui-btn mui-btn-block mui-btn-primary">去登录</button></a>
    </div>
</div>
{include file="public/footer" /}
<script>
    $('#submit').on('click',function(){
        var params  = {
            url : "{:url('reg')}",
            data: $("form").serialize(),
            type: 'post',
            module: 'index',
            sCallback:function(res){
                window.location.href = "{:url('wechat')}"
            }
        }
        common.request(params);
    });
    var countdown=60;
    function sendemail(){
        var obj = $("#reg-user");
        settime(obj);

    }
    function settime(obj) { //发送验证码倒计时
//        countdown--;
        if (countdown == 1) {
            obj.attr('disabled',false);
//            obj.attr("disabled");
            obj.val("获取验证码");
            $("#reg-user").html("重新获取");
            countdown = 60;
            return;
        } else {
            obj.attr('disabled',true);
            obj.val("重新发送(" + countdown + ")");
            countdown--;
            $("#reg-user").html(obj.val());
//            console.log(obj.html())
        }
        setTimeout(function() {
                    settime(obj) }
                ,1000)
    }

</script>

</body>
</html>
